<%@ page import="musgo.Cancion" %>



<div class="fieldcontain ${hasErrors(bean: cancionInstance, field: 'nombreC', 'error')} required">
	<label for="nombreC">
		<g:message code="cancion.nombreC.label" default="Nombre C" />
		<span class="required-indicator">*</span>
	</label>
	<g:textField name="nombreC" maxlength="128" required="" value="${cancionInstance?.nombreC}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: cancionInstance, field: 'valoracion', 'error')} required">
	<label for="valoracion">
		<g:message code="cancion.valoracion.label" default="Valoracion" />
		<span class="required-indicator">*</span>
	</label>
	<g:select name="valoracion" from="${cancionInstance.constraints.valoracion.inList}" required="" value="${fieldValue(bean: cancionInstance, field: 'valoracion')}" valueMessagePrefix="cancion.valoracion"/>
</div>

<div class="fieldcontain ${hasErrors(bean: cancionInstance, field: 'letra', 'error')} ">
	<label for="letra">
		<g:message code="cancion.letra.label" default="Letra" />
		
	</label>
	<g:textArea name="letra" cols="40" rows="5" maxlength="5000" value="${cancionInstance?.letra}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: cancionInstance, field: 'mp3', 'error')} ">
	<label for="mp3">
		<g:message code="cancion.mp3.label" default="Mp3" />
		
	</label>
	<g:select id="mp3" name="mp3.id" from="${musgo.ArchivoMusica.list()}" optionKey="id" value="${cancionInstance?.mp3?.id}" class="many-to-one" noSelection="['null': '']"/>
</div>

<div class="fieldcontain ${hasErrors(bean: cancionInstance, field: 'album', 'error')} required">
	<label for="album">
		<g:message code="cancion.album.label" default="Album" />
		<span class="required-indicator">*</span>
	</label>
	<g:select id="album" name="album.id" from="${musgo.Album.list()}" optionKey="id" required="" value="${cancionInstance?.album?.id}" class="many-to-one"/>
</div>

<div class="fieldcontain ${hasErrors(bean: cancionInstance, field: 'cometarios', 'error')} ">
	<label for="cometarios">
		<g:message code="cancion.cometarios.label" default="Cometarios" />
		
	</label>
	
<ul class="one-to-many">
<g:each in="${cancionInstance?.cometarios?}" var="c">
    <li><g:link controller="comentario" action="show" id="${c.id}">${c?.encodeAsHTML()}</g:link></li>
</g:each>
<li class="add">
<g:link controller="comentario" action="create" params="['cancion.id': cancionInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'comentario.label', default: 'Comentario')])}</g:link>
</li>
</ul>

</div>

<div class="fieldcontain ${hasErrors(bean: cancionInstance, field: 'duracion', 'error')} required">
	<label for="duracion">
		<g:message code="cancion.duracion.label" default="Duracion" />
		<span class="required-indicator">*</span>
	</label>
	<g:field name="duracion" value="${fieldValue(bean: cancionInstance, field: 'duracion')}" required=""/>
</div>

<div class="fieldcontain ${hasErrors(bean: cancionInstance, field: 'numdescargas', 'error')} required">
	<label for="numdescargas">
		<g:message code="cancion.numdescargas.label" default="Numdescargas" />
		<span class="required-indicator">*</span>
	</label>
	<g:field name="numdescargas" type="number" value="${cancionInstance.numdescargas}" required=""/>
</div>

<div class="fieldcontain ${hasErrors(bean: cancionInstance, field: 'reproducciones', 'error')} required">
	<label for="reproducciones">
		<g:message code="cancion.reproducciones.label" default="Reproducciones" />
		<span class="required-indicator">*</span>
	</label>
	<g:field name="reproducciones" type="number" value="${cancionInstance.reproducciones}" required=""/>
</div>

